import request from "@/router/axios";

export const getParentList = (current, size,params) => {
  return request({
    url: '/api/hg-logistics/pallet-operation/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getChildList = (current, size, palletNo) => {
  return request({
    url: '/api/hg-logistics/pallet-operation/pallet-box-page',
    method: 'get',
    params: {
      palletNo,
      current,
      size,
    }
  })
}

export const getSubDetailList = (palletNo) => {
  return request({
    url: '/api/hg-logistics/pallet-operation/pallet-box-List',
    method: 'get',
    params: {
      palletNo,
    }
  })
}

export const getNumberForPallet = (materialInnerCode,date,count) => {
  return request({
    url: '/api/hg-logistics/pallet-no-generator',
    method: 'get',
    params: {
      materialInnerCode,
      date,
      count,
    }
  })
}

export const subOrder = (data) => {
  return request({
    url: '/api/hg-logistics/pallet-operation/quick-split',
    method: 'post',
    data:data,
    responseType:'blob',
  })
}

export const sumOrder = (data) => {
  return request({
    url: '/api/hg-logistics/pallet-operation/quick-combine',
    method: 'post',
    data:data,
    responseType:'blob',
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/hg-logistics/pallet-operation/remove',
    method: 'delete',
    params: {
      ids,
    }
  })
}
